#include <bits/stdc++.h>

using namespace std;
const int N = 100010;

int f[N][2];
int a[N];
int t;
int main()
{
    cin >> t;
    while (t--)
    {
        int n;
        scanf("%d", &n);
        for (int i = 1; i <= n; ++i)
        {
            scanf("%d", &a[i]);
        }

        for (int i = 1; i <= n; ++i)
        {
            f[i][1] = f[i - 1][0] + a[i];
            f[i][0] = max(f[i- 1][0], f[i - 1][1]);
        }
        printf("%d\n", max(f[n][0], f[n][1]));
    }
    return 0;
}